import axios from 'axios'
import cookie from '../../assets/js/cookie'
/* 项目的service */
export default {
	//获取开单的分页数据
	getApplyListByCheck(checkOrderId) {
		var reqData={  
			checkOrderId: checkOrderId,
		};
		return axios.get('/thridclassroom/appeal_order/selectable',{
            　　params:reqData
        });
	},	//开单
	doAppealApplyOrder(checkOrderId,appealDesc,imgList) {
		var reqData={
			checkOrderId:checkOrderId,
			appealDesc:appealDesc,
			imgList:imgList,
		};
		reqData = cookie.setOpenInfoToData(reqData);
		return axios({
			url:'/thridclassroom/appeal_order/doOpenApprealOrder',
			method: 'post',
			data: reqData,
		});
	},
	//获取考核单的分页数据
	getMyAppealOrderPage(page,param) {
		var reqData={  
			page: page,
			params: param, //+'?'+ this.$qs.stringify(reqData)
			rows: 10
		};
		return axios({
			url:'/thridclassroom/appeal_order/page',
			method: 'post',
			data: reqData,
		});
	},
	//获取教师的考核单的分页数据
	getTeacherAppealOrderPage(page,param) {
		var reqData={  
			page: page,
			params: param, //+'?'+ this.$qs.stringify(reqData)
			rows: 10
		};
		console.log("request",reqData);
		return axios({
			url:'/thridclassroom/appeal_order/teacher/page',
			method: 'post',
			data: reqData,
		});
	},
	//获取考核单的分页数据
	getAppealApply(id,params) {
		return axios.get('/thridclassroom/appeal_order/'+id,{
            　　params:params
        });
	},
	//操作考核单  state 审批状态，学生撤诉：0，待审批：1，审批通过：2，审批不通过：3
	doChangeStateAppealOrder(id,state,refuseKeywords,refuseReason) {
		var reqData={  
			id: id,
			authState: state,
			refuseKeywords: refuseKeywords, //+'?'+ this.$qs.stringify(reqData)
			refuseReason: refuseReason
		};
		var userData = cookie.setOpenInfoToData({});

		reqData.authUserId=userData.operUserId;
		reqData.authFileId=userData.operFileId;
		reqData.authName=userData.operName;
		reqData.authCellphone=userData.operCellphone;


		return axios({
			url:'/thridclassroom/appeal_order/doChangeState',
			method: 'post',
			data: reqData,
		});
	},
 }